import { useMemo } from 'react';
import { isNumber, sum } from 'lodash';

const useScrollX = columns =>
  useMemo(() => sum(columns.map(n => (isNumber(n.width) ? n.width : 100))), [columns.length]);

  export default useScrollX;
